package fr;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestServlet extends HttpServlet{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {


		
		
		

	}
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse resp)
			throws ServletException, IOException {
		
		

        PrintWriter writer = resp.getWriter();
		
        writer.println("<html>");
		writer.println("<h1>Hello World !!!</h1>" + request.getParameter("action"));
		
        writer.println(request.getRequestURI());
		
		
		
		if ( request.getParameter("action") != null ) {
			
			if ( request.getParameter("action").equals("open")) {
				Controller c = new Controller();
				c.open();
				
			}
			
		}
		
		
		
        writer.println("</html>");
		System.out.println("test ? get");
	}

}
